Skip to main content

All Questions

Tagged with
1vote
5answers
1kviews

Replace hyphen(s) with underscore(s) within angle brackets in a file

I’m aware of how to replace string; e.g., replace hyphen with underscore in a file. However, I wish to replace all hyphens with underscore for all text that falls within angle brackets in a given file....
Ashar's user avatar
2votes
1answer
538views

How to add closing XML tags with sed

I have the following example in the XML doc: <meta name=Originator content="text/html; charset=iso-8859-6"> <meta name=ProgId content=Word.Document> <meta name=Generator ...
Miloš's user avatar
2votes
2answers
4kviews

AIX - Using Sed To Replace A String In A File

On RHEL, I am able to utilize the sed -i command to replace a string within a file, however, on AIX, it seems like the same -i parameter cannot be used. I have a file called abc.xml that contains the ...
Help's user avatar
0votes
2answers
585views

How do I replace a certain pattern in multiple files?

My goal to update version number in multiple XML file like following <?xml version="1.0" encoding="UTF-8"?> <Component xmlns="http://soap.sforce.com/2006/04/metadata&...
Patlatus's user avatar
3votes
6answers
3kviews

Using sed to replace substrings between specific tags

I want to combine two sed command in one and really don't know how to do it, I've tried multiple things without success. For the result I want all slash between a specific tag to be replaced with ...
J-F T's user avatar
0votes
3answers
2kviews

how to find & replace a file path listed in a file

I have a file content as shown below. If a line has ".idt" word, then I need to check if there is a file path preceding it (eg: /bin/dir/test/abcdef.idt). If yes, then remove the file path and keep ...
viki143's user avatar
0votes
3answers
20kviews

Search and replace specific tag value in XML file with sed command

I have a task where by I have to manipulate an XML file through a bash shell script. Here are the steps: Query XML file for a value. Replace the value of a different element with the new value. ...
user3611640's user avatar
3votes
6answers
3kviews

Replacement of XML based on attribute content using sed

I've got to replace some attribute content in an XML tag, depending on a parameter $1. We've got in input, for example: <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="OO ...
buzz2buzz's user avatar
0votes
1answer
1kviews

How do I replace the '&#x5c' with '/' in file using the command line?

After grep line with AAA/BBB/CCC but the output file consists only the line as AAA"& #x5c;"BBB"& #x5c;"CCC.. How do I fix this?
karthick127's user avatar
1vote
2answers
348views

search and replace string

I have a XML tag for example <tag name="abc"></tag> I wanted to replace the string inside "" with the tag name i.e the upper XML tag should be become now <abc name="abc"></...
akhilesh's user avatar
2votes
2answers
6kviews

regex replace text in xml file within node from the command line

I have an XML file and I would like to replace everything that is between the open and closing tag within multiple instances of the g:gtin node with nothing. Is this possible from the command line, ...
crmpicco's user avatar

close